﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using RESTServices.Dominio;
using RESTServices.Persistencia;

namespace RESTServices
{
    
    public class Peliculas : IPeliculas
    {
        private PeliculaDAO dao = new PeliculaDAO();

        public Pelicula CrearPelicula(Pelicula peliculaCrear)
        {
            return dao.Crear(peliculaCrear);
        }

        public Pelicula ObtenerPelicula(string idpelicula)
        {
            return dao.Obtener(int.Parse(idpelicula));
        }

        public Pelicula ModificarPelicula(Pelicula peliculaModificar)
        {
            return dao.Modificar(peliculaModificar);
        }

        public void EliminarPelicula(string idpelicula)
        {
            dao.Eliminar(ObtenerPelicula(idpelicula));
        }

        public List<Pelicula> ListarPeliculas()
        {
            return dao.ListarTodos().ToList();
        }
    }
}
